package com.act.moudles.baseAct.entity;

import java.util.Date;

import com.act.utils.validations.AddGroup;
import com.act.utils.validations.UpdateGroup;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 节点方法/权限配置(TaskAnoPris)表实体类
 *
 * @author makejava
 * @since 2023-05-15 10:54:45
 */
@SuppressWarnings("serial")
@Data
@TableName("s_task_ano_pris")
public class TaskAnoPris {
    //主键
    @TableId
    @NotNull(message = "主键ID不能为空",groups = { UpdateGroup.class})
    private Long prisId;
    //节点Id
    private Long anoId;
    //方法名称
    @NotEmpty(message = "方法名称不能为空",groups = {AddGroup.class, UpdateGroup.class})
    private String prisName;
    //方法编码
    @NotEmpty(message = "方法编码不能为空",groups = {AddGroup.class, UpdateGroup.class})
    private String prisCode;
    //方法入参
    private String inParams;
    //方法出差
    private String outParams;
    //位置：0前，1当中，2后
    private Integer prisLoc;
    //删除标志（0代表存在 2代表删除）
    private Integer delFlag;
    //创建者
    private String createBy;
    //创建时间
    private Date createTime;
    //更新者
    private String updateBy;
    //更新时间
    private Date updateTime;
    //备注
    private String remark;

    public LambdaQueryWrapper<TaskAnoPris>  query(){
        LambdaQueryWrapper<TaskAnoPris> query = new LambdaQueryWrapper<>();
        query.eq(anoId != null,TaskAnoPris::getAnoId,anoId);
        query.eq(prisId != null,TaskAnoPris::getPrisId,prisId);
        query.eq(prisLoc != null,TaskAnoPris::getPrisLoc,prisLoc);
        query.eq(TaskAnoPris::getDelFlag,1);
        query.like(StringUtils.isNotEmpty(prisName),TaskAnoPris::getPrisName,prisName);
        return query;
    }


}

